package com.feifan.consumer.aop;

import com.feifan.api.model.UmsLog;
import com.feifan.api.model.UmsLogType;
import com.feifan.api.service.IUserLogService;

/**
 * @program: FinalProject
 * @author: Xiaofan
 * @createTime: 2021-08-05 15:53
 * @description: Functions of this class is
 **/
public class SaveSystemLogThread implements Runnable{

    private UmsLog log;
    private IUserLogService logService;
    public SaveSystemLogThread(){}
    public SaveSystemLogThread( UmsLog log, IUserLogService logService){
        this.log=log;
        this.logService=logService;
    }
    @Override
    public void run() {
        if(log.getLogType()!=null){//如果日志内容不为空的话
            logService.insert(log);
        }
    }
}